//
//  NSString+DSValidate.m
//  DaBaiService
//
//  Created by Liuwenyang on 15/12/13.
//  Copyright © 2015年 Mac-Mini-KingVision. All rights reserved.
//

#import "NSString+DSValidate.h"

@implementation NSString (DSValidate)

-(BOOL)isMoney
{
    //^(([0-9]|([1-9][0-9]{0,9}))((\.[0-9]{1,2})?))$
    //NSString * reg = @"^[0-9]{0,5}+(.[0-9]{0,2})?$";
    NSString * reg = @"^(([0-9]|([1-9][0-9]{0,4}))((\\.[0-9]{0,2})?))$";
    NSPredicate * predicate = [NSPredicate predicateWithFormat: @"SELF MATCHES %@", reg];
    
    return [predicate evaluateWithObject: self];
}

@end
